

var hotEmitter = require("../../webpack/hot/emitter");
// 通过socket连接客户端
var socket = io();
// 当前最新的hash值
var currentHash = "";

// var initial = true;
socket.on("hash", (hash) => {
    console.log('客户端拿到hash消息')
  currentHash = hash;
});
socket.on("ok", () => {
    console.log('客户端拿到ok消息')

//   if(initial){
//     return initial=false;  
//   }
  reloadApp();
});

function reloadApp() {
  hotEmitter.emit("webpackHotUpdate", currentHash);
}
